<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8"/>
    <title>refundUploader主题 </title>
    <script src="http://g.tbcdn.cn/kissy/k/1.4.2/seed-min.js" charset="utf-8"></script>
</head>

<body>
<h2>refundUploader主题</h2>
<ul>
    <li><a href="https://github.com/KF-kissyForm/butterfly/tree/master/gallery/uploader/1.5.4/themes/refundUploader" target="_blank">源码</a></li>
    <li>作者：明河</li>
    <li>设计：苛卡</li>
    <li>描述：来源于淘宝退款，亮点在于满最大上传数时按钮文案的变化，v1.4新增图片放大器插件</li>
    <li>案例：淘宝退款申请页面的上传凭证</li>
    <li>兼容：IE6+、chrome、firefox、safari</li>
</ul>

<div class="grid">
    <input type="file" class="g-u" id="J_UploaderBtn" value="上传图片" name="Filedata"  accept="image/*" >
    <input type="hidden" id="J_Urls" name="refundImageUrls">
</div>
<ul id="J_UploaderQueue" class="grid">

</ul>

<script type="text/javascript">
    var S = KISSY;
    if (S.Config.debug) {
        var srcPath = "../../../../";
        S.config({
            packages:[
                {
                    name:"gallery",
                    path:srcPath,
                    charset:"utf-8"
                }
            ]
        });
    }

    S.use('gallery/uploader/1.5.4/index,gallery/uploader/1.5.4/themes/refundUploader/index,gallery/uploader/1.5.4/themes/refundUploader/style.css', function (S, Uploader,RefundUploader) {
        //上传组件插件
        var plugins = 'gallery/uploader/1.5.4/plugins/auth/auth,' +
                'gallery/uploader/1.5.4/plugins/urlsInput/urlsInput,' +
                'gallery/uploader/1.5.4/plugins/proBars/proBars,' +
                'gallery/uploader/1.5.4/plugins/filedrop/filedrop,' +
                'gallery/uploader/1.5.4/plugins/preview/preview,' +
                'gallery/uploader/1.5.4/plugins/imageZoom/imageZoom';

        S.use(plugins,function(S,Auth,UrlsInput,ProBars,Filedrop,Preview,ImageZoom){
            var uploader = new Uploader('#J_UploaderBtn',{
                //处理上传的服务器端脚本路径
                action:"upload.php"
            });
            //使用主题
            uploader.theme(new RefundUploader({
                queueTarget:'#J_UploaderQueue'
            }))
            //验证插件
            uploader.plug(new Auth({
                        //最多上传个数
                        max:3,
                        //图片最大允许大小
                        maxSize:100
                    }))
                //url保存插件
                    .plug(new UrlsInput({target:'#J_Urls'}))
                //进度条集合
                    .plug(new ProBars())
                //拖拽上传
                    .plug(new Filedrop())
                //图片预览
                    .plug(new Preview())
                    .plug(new ImageZoom())
            ;
        });
    })
</script>
</body>
</html>
